package com.project.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@Validated
@ApiModel(value = "Users",description = "用户信息")
public class Users implements Serializable,Cloneable {
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID",example = "1")
    private Integer user_id;
    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名",example = "张三")
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "/ ^[\u4E00-\u9FA5]+$/",message = "用户名只能为2-7位中文")
    private String user_name;
    /**
     * 电话
     */
    @ApiModelProperty(value = "用户电话",example = "1")
    @NotBlank(message = "电话号码不能为空")
    @Size(min = 11,max = 11)
    @Pattern(regexp = "/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$/",message = "请输入正确的手机号码")
    private String user_telephone;
    /**
     * 密码
     */
    @ApiModelProperty(value = "用户密码",example = "123456")
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 18)
    @Pattern(regexp = "/^(\\w){6,18}$/",message = "只能输入6-18个字母、数字、下划线")
    private String user_password;
    /**
     * 性别
     */

    @ApiModelProperty(value = "性别",example = "男，女")
    @Pattern(regexp = "/\\b(男|女)\\b/")
    private String user_sex;
    /**
     * 头像
     */
    @ApiModelProperty(value = "用户图片",example = " ")
    private String user_photo;
    /**
     * 用户状态
     */
    @ApiModelProperty(value = "用户状态",example = "是否禁用")
    private String user_state;
    @ApiModelProperty(value = "用户车辆",example = "1")
    private Vehicle vehicle;
    @ApiModelProperty(value = "用户车位",example = "1")
    private Stall stall;
    @ApiModelProperty(value = "用户会员",example = "1")
    private Member member;

}

